package com.rpframework.website.device.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.rpframework.core.BaseService;
import com.rpframework.utils.Pager;
import com.rpframework.website.device.dao.IStreamDao;
import com.rpframework.website.device.domain.Stream;


@Service
public class StreamService extends BaseService{
public	@Resource IStreamDao iStreamdao;
	/**
	 * 查询所有标签
	 * @param pager
	 * @return
	 */
	public Pager<Stream> widenpager(Pager<Stream> pager){
		long startTime=System.currentTimeMillis();
		List<Stream>  list=iStreamdao.doPager(this.packageMyBatisParam(pager));
		pager.setItemList(list);
		pager.setCostTime(System.currentTimeMillis() - startTime);
		return pager;
	}
	/**
	 * 通过id查询
	 * @param id
	 * @return
	 */
	public Stream selectOnlyOne(Integer id){
		Stream user = iStreamdao.select(id);
		return user;
	}
	/**
	 *修改用户
	 * @param user
	 * @return
	 */
	public boolean updatewiden(Stream Stream){
		boolean c=iStreamdao.update(Stream);
		return c;
	}
	/**
	 *添加用户
	 * @param user
	 * @return
	 */
	public boolean wideninsert(Stream Stream){
		boolean c=iStreamdao.insert(Stream);
		return c;
	}
	/**
	 *删除用户
	 * @param user
	 * @return
	 */
	public boolean deletesell(Integer id){
		iStreamdao.delete(id);
		return true;
	}
}
